package com.sprouting.personal.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sprouting.personal.dao.WordGroupDao;
import com.sprouting.personal.model.entity.WordGroup;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 单词组
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2023/1/3 11:29
 */
@Service
@Slf4j
public class WordGroupService extends ServiceImpl<WordGroupDao, WordGroup> {

    @Resource
    private WordGroupDao wordGroupDao;

    /**
     * 根据单词组名称查询单词组
     * @param id 传则忽略ID
     * @param userId 当前登录用户
     * @param name 单词组名称
     * @return
     */
    public WordGroup getWordGroupById(String id, String userId, String name) {
        return wordGroupDao.getWordGroupById(id, userId, name);
    }

    /**
     * 分页查询单词组
     * @param page 分页条件
     * @param wordGroup 查询条件
     * @return
     */
    public Page<WordGroup> getWordGroupListPage(Page page, WordGroup wordGroup) {
        return wordGroupDao.getWordGroupListPage(page, wordGroup);
    }
}
